﻿using OpenApi;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;
using SuperLottery;
using SuperLottery.Models;

namespace SuperLottery
{
	/// <summary>
	/// 开奖公告服务接口
	/// </summary>
	[ServiceContract(Name = "LotteryDraw")]
	public interface ILotteryDrawService
	{
		/// <summary>
		/// 获取最新开奖公告
		/// </summary>
		/// <param name="count">单页记录数</param>
		/// <param name="page">结果页码</param>
		/// <returns></returns>
		[OperationContract]
		[WebGet(UriTemplate = "Latest?Count={Count}&Page={Page}")]
		List<LotteryDraw> GetLatestLotteryDraws(int count, int page);

		/// <summary>
		/// 获取某个玩法（彩种）的最新开奖公告
		/// </summary>
		/// <param name="issuer">发行者</param>
		/// <param name="game">玩法（彩种）</param>
		/// <param name="count">单页记录数</param>
		/// <param name="page">结果页码</param>
		/// <returns></returns>
		[OperationContract]
		[WebGet(UriTemplate = "List?Issuer={Issuer}&Game={Game}&Count={Count}&Page={Page}")]
		List<LotteryDraw> GetLotteryDraws(string issuer, string game, int count, int page);

		/// <summary>
		/// 获取某个玩法（彩种）某一期的开奖公告
		/// </summary>
		/// <param name="issuer">发行者</param>
		/// <param name="game">玩法（彩种）</param>
		/// <param name="issueNumber">期号</param>
		/// <returns></returns>
		[OperationContract]
		[WebGet(UriTemplate = "Get?Issuer={Issuer}&Game={Game}&IssueNumber={IssueNumber}")]
		LotteryDraw GetLotteryDraw(string issuer, string game, string issueNumber);

		/// <summary>
		/// 获取某个公告的中奖明细
		/// </summary>
		/// <param name="drawId">公告编号</param>
		/// <returns></returns>
		[OperationContract]
		[WebGet(UriTemplate = "WinningDetails?DrawId={DrawId}")]
		List<WinningDetail> GetWinningDetails(long drawId);
	}
}
